<template>
	<view class="home">
		<view class="search">
			<image src="../../assets/home/search.png" mode="widthFix"></image>
			<input type="text" placeholder="搜索" />
		</view>
		<view class="ul">
			<view class="li" v-for="item in list" :key="item.id" @click="clickItem(item)">
				<image :src="getImg(item)" mode="widthFix"></image>
				<view class="banner">
					<view class="title">{{item.title}}</view>
					<view class="describ">{{item.describ}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						title: "运输管理",
						describ: "点击查看订单",
						img: "yunshu",
						id: 1,
						url:"/pages/transpotation/index"
					},
					{
						title: "客服管理",
						img: "kefu",
						describ: "咨询售后客服",
						id: 2,
					},
					{
						title: "仓库管理",
						img: "cangku",
						describ: "仓库信息处理",
						id: 3,
					},
				],
			}
		},
		methods: {
			getImg(item) {
				return `/static/${item.img}.png`
			},
			clickItem(item){
				if(item.url){
					uni.navigateTo({
						url:item.url,
					})
				}
			},
		},
	}
</script>

<style lang="scss" scoped>
	.home {
		.search {
			margin: 44rpx auto;
			display: flex;
			align-items: center;
			width: 702rpx;
			height: 60rpx;
			background: #F5F5F5;
			border-radius: 98rpx 98rpx 98rpx 98rpx;
			position: relative;
			z-index: 10;
			padding: 0 16rpx;

			image {
				width: 40rpx;
				margin-right: 14rpx;

			}

			input {
				width: 1px;
				flex-grow: 1;
				height: 100%;
			}
		}

		.ul {
			position: relative;
			z-index: 10;
			margin-left: 24rpx;
			
			.li {
				width: 702rpx;
				height: 240rpx;
				background: #FFFFFF;
				border-radius: 24rpx 24rpx 24rpx 24rpx;
				display: flex;
				align-items: center;
				padding: 0 60rpx;

				&+.li {
					margin-top: 20rpx;
				}

				image {
					width: 140rpx;
					height: 140rpx;
				}

				.banner {
					padding-left: 60rpx;

					.title {
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 500;
						font-size: 32rpx;
						color: #000000;
						line-height: 38rpx;
						text-align: left;
						font-style: normal;
						text-transform: none;
					}

					.describ {
						margin-top: 8rpx;
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #666666;
						line-height: 33rpx;
						text-align: left;
						font-style: normal;
						text-transform: none;
					}
				}
			}
		}
	}
</style>